<template>
    <div>
      <schart :canvasId="canvasId"
              :type="type"
              :width="width"
              :height="height"
              :data="data"
              :options="options"
      />
    </div>
</template>

<script>
  import Schart from 'vue-schart';

  export default {
    name: "chart",
    data() {
      return {
        canvasId: 'myChart',
        type: 'pie',
        width: 600,
        height: 500,
        data: [
          {name: '期刊', value: 1234},
          {name: '图书', value: 2345},
          {name: '小说', value: 2456},
          {name: '文学', value: 333},
        ],
        options: {
          title: 'example vue-schart',
          bgColor: '#829dca',
          titleColor: '#ffffff',
          legendColor: '#ffffff'
        }
      }
    },
    components:{
      Schart
    }
  }
</script>

<style scoped>

</style>
